From 393024529af7c699a3ec17ad40d7935e80b8fa13 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Mon, 5 Jul 2004 15:01:15 +0000 Subject: [PATCH] bitkeeper revision 1.1041.6.6 (40e96d3bioFNWNS55cowRl9PXLQZ9Q) More x86-64 stuff. --- .rootkeys | 15 +-- xen/arch/x86/Makefile | 5 + xen/arch/x86/Rules.mk | 2 +- xen/arch/x86/apic.c | 6 +- xen/arch/x86/{process.c => domain.c} | 11 +- xen/arch/x86/irq.c | 4 + xen/arch/x86/mpparse.c | 4 +- xen/arch/x86/rwlock.c | 12 +-- xen/arch/x86/setup.c | 10 ++ xen/arch/x86/smpboot.c | 2 + xen/arch/x86/time.c | 19 ++-- xen/arch/x86/trampoline.S | 6 +- xen/arch/x86/traps.c | 4 + xen/arch/x86/{ => x86_32}/domain_page.c | 0 xen/arch/x86/{ => x86_32}/entry.S | 0 xen/arch/x86/{ => x86_32}/mm.c | 0 xen/arch/x86/{ => x86_32}/usercopy.c | 0 xen/arch/x86/{ => x86_32}/xen.lds | 0 xen/arch/x86/x86_64/entry.S | 0 xen/arch/x86/x86_64/usercopy.c | 136 ++++++++++++++++++++++++ xen/arch/x86/x86_64/xen.lds | 85 +++++++++++++++ xen/include/asm-x86/config.h | 4 +- xen/include/asm-x86/irq.h | 24 +++-- 23 files changed, 306 insertions(+), 43 deletions(-) rename xen/arch/x86/{process.c => domain.c} (98%) rename xen/arch/x86/{ => x86_32}/domain_page.c (100%) rename xen/arch/x86/{ => x86_32}/entry.S (100%) rename xen/arch/x86/{ => x86_32}/mm.c (100%) rename xen/arch/x86/{ => x86_32}/usercopy.c (100%) rename xen/arch/x86/{ => x86_32}/xen.lds (100%) create mode 100644 xen/arch/x86/x86_64/entry.S create mode 100644 xen/arch/x86/x86_64/usercopy.c create mode 100644 xen/arch/x86/x86_64/xen.lds diff --git a/.rootkeys b/.rootkeys index c575ef31d3..3adfa562aa 100644 --- a/.rootkeys +++ b/.rootkeys @@ -286,8 +286,7 @@ 3ddb79bcSC_LvnmFlX-T5iTgaR0SKg xen/arch/x86/boot/x86_32.S 40e42bdbNu4MjI750THP_8J1S-Sa0g xen/arch/x86/boot/x86_64.S 3ddb79bcUrk2EIaM5VsT6wUudH1kkg xen/arch/x86/delay.c -3e32af9aRnYGl4GMOaDKp7JdfhOGhg xen/arch/x86/domain_page.c -3ddb79bcecupHj56ZbTa3B0FxDowMg xen/arch/x86/entry.S +3ddb79bc1_2bAt67x9MFCP4AZrQnvQ xen/arch/x86/domain.c 3ddb79bcY5zW7KhvI9gvfuPi3ZumEg xen/arch/x86/extable.c 3fe443fdDDb0Sw6NQBCk4GQapayfTA xen/arch/x86/flushtlb.c 3ddb79bcesE5E-lS4QhRhlqXxqj9cA xen/arch/x86/i387.c @@ -295,7 +294,6 @@ 3ddb79bcBit4xJXbwtX0kb1hh2uO1Q xen/arch/x86/idle0_task.c 3ddb79bcKIkRR0kqWaJhe5VUDkMdxg xen/arch/x86/io_apic.c 3ddb79bdqfIcjkz_h9Hvtp8Tk_19Zw xen/arch/x86/irq.c -3ddb79bcHwuCQDjBICDTSis52hWguw xen/arch/x86/mm.c 3ddb79bdS4UeWWXDH-FaBKqcpMFcnw xen/arch/x86/mpparse.c 3f12cff65EV3qOG2j37Qm0ShgvXGRw xen/arch/x86/nmi.c 3ddb79bdHe6_Uij4-glW91vInNtBYQ xen/arch/x86/pci-irq.c @@ -304,7 +302,6 @@ 3ddb79bdIKgipvGoqExEQ7jawfVowA xen/arch/x86/pci-x86.h 40a4dfced2dnSzbKgJFlD3chKHexjQ xen/arch/x86/pdb-linux.c 4022a73czgX7d-2zfF_cb33oVemApQ xen/arch/x86/pdb-stub.c -3ddb79bc1_2bAt67x9MFCP4AZrQnvQ xen/arch/x86/process.c 3ddb79bc7KxGCEJsgBnkDX7XjD_ZEQ xen/arch/x86/rwlock.c 3ddb79bcrD6Z_rUvSDgrvjyb4846Eg xen/arch/x86/setup.c 3ddb79bcSx2e8JSR3pdSGa8x1ScYzA xen/arch/x86/smp.c @@ -312,8 +309,14 @@ 3ddb79bc-Udq7ol-NX4q9XsYnN7A2Q xen/arch/x86/time.c 3ddb79bccYVzXZJyVaxuv5T42Z1Fsw xen/arch/x86/trampoline.S 3ddb79bcOftONV9h4QCxXOfiT0h91w xen/arch/x86/traps.c -3ddb79bc4nTpGQOe6_-MbyZzkhlhFQ xen/arch/x86/usercopy.c -3ddb79bcOMCu9-5mKpjIh5d0qqBDPg xen/arch/x86/xen.lds +3e32af9aRnYGl4GMOaDKp7JdfhOGhg xen/arch/x86/x86_32/domain_page.c +3ddb79bcecupHj56ZbTa3B0FxDowMg xen/arch/x86/x86_32/entry.S +3ddb79bcHwuCQDjBICDTSis52hWguw xen/arch/x86/x86_32/mm.c +3ddb79bc4nTpGQOe6_-MbyZzkhlhFQ xen/arch/x86/x86_32/usercopy.c +3ddb79bcOMCu9-5mKpjIh5d0qqBDPg xen/arch/x86/x86_32/xen.lds +40e96d3aLDI-nViMuYneD7VKYlZrVg xen/arch/x86/x86_64/entry.S +40e96d3ahBTZqbTViInnq0lM03vs7A xen/arch/x86/x86_64/usercopy.c +40e96d3akN3Hu_J5Bk-WXD8OGscrYQ xen/arch/x86/x86_64/xen.lds 3ddb79bdff-gj-jFGKjOejeHLqL8Lg xen/common/Makefile 3e397e66AyyD5fYraAySWuwi9uqSXg xen/common/ac_timer.c 4022a73c_BbDFd2YJ_NQYVvKX5Oz7w xen/common/debug-linux.c diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index f6ef36afce..039df504ef 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -6,6 +6,9 @@ OBJS := $(subst pdb-linux.o,,$(OBJS)) OBJS := $(subst pdb-stub.o,,$(OBJS)) endif +OBJS += $(patsubst %.S,%.o,$(wildcard $(TARGET_SUBARCH)/*.S)) +OBJS += $(patsubst %.c,%.o,$(wildcard $(TARGET_SUBARCH)/*.c)) + LINK_BASE := 0xFC500000 # Xen is linked here LOAD_BASE := 0x00100000 # Xen is loaded here @@ -23,3 +26,5 @@ default: boot/$(TARGET_SUBARCH).o $(OBJS) clean: rm -f *.o *~ core boot/*.o boot/*~ boot/core + rm -f $(TARGET_SUBARCH)/*.o $(TARGET_SUBARCH)/*~ + rm -f $(TARGETSUBARCH)/core diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk index 5963e99d80..560b381845 100644 --- a/xen/arch/x86/Rules.mk +++ b/xen/arch/x86/Rules.mk @@ -8,7 +8,7 @@ CFLAGS := -nostdinc -fno-builtin -fno-common -fno-strict-aliasing -O3 CFLAGS += -iwithprefix include -Wall -Werror -fomit-frame-pointer CFLAGS += -I$(BASEDIR)/include -Wno-pointer-arith -Wredundant-decls -LDFLAGS := -T xen.lds -N +LDFLAGS := -T $(TARGET_SUBARCH)/xen.lds -N ifeq ($(TARGET_SUBARCH),x86_32) CFLAGS += -m32 -march=i686 diff --git a/xen/arch/x86/apic.c b/xen/arch/x86/apic.c index cd1733c173..64974f670d 100644 --- a/xen/arch/x86/apic.c +++ b/xen/arch/x86/apic.c @@ -491,9 +491,9 @@ void __init init_apic_mappings(void) *****************************************************************************/ /* used for system time scaling */ -static unsigned int bus_freq; -static u32 bus_cycle; /* length of one bus cycle in pico-seconds */ -static u32 bus_scale; /* scaling factor convert ns to bus cycles */ +static unsigned long bus_freq; /* KAF: pointer-size avoids compile warns. */ +static u32 bus_cycle; /* length of one bus cycle in pico-seconds */ +static u32 bus_scale; /* scaling factor convert ns to bus cycles */ /* * The timer chip is already set up at HZ interrupts per second here, diff --git a/xen/arch/x86/process.c b/xen/arch/x86/domain.c similarity index 98% rename from xen/arch/x86/process.c rename to xen/arch/x86/domain.c index d3bf5ab4b8..459a85b393 100644 --- a/xen/arch/x86/process.c +++ b/xen/arch/x86/domain.c @@ -1,17 +1,10 @@ /* - * linux/arch/i386/kernel/process.c - * * Copyright (C) 1995 Linus Torvalds * * Pentium III FXSR, SSE support * Gareth Hughes , May 2000 */ -/* - * This file handles the architecture-dependent parts of process handling.. - */ - -#define __KERNEL_SYSCALLS__ #include #include #include @@ -192,6 +185,8 @@ void machine_power_off(void) machine_restart(0); } +#if defined(__i386__) + void new_thread(struct domain *p, unsigned long start_pc, unsigned long start_stack, @@ -361,3 +356,5 @@ long do_iopl(domid_t domain, unsigned int new_io_pl) ec->eflags = (ec->eflags & 0xffffcfff) | ((new_io_pl&3) << 12); return 0; } + +#endif diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 950138849b..af0b0de1fb 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -89,7 +89,11 @@ void enable_irq(unsigned int irq) asmlinkage void do_IRQ(struct pt_regs regs) { +#if defined(__i386__) unsigned int irq = regs.orig_eax; +#else + unsigned int irq = 0; /* XXX */ +#endif irq_desc_t *desc = &irq_desc[irq]; struct irqaction *action; diff --git a/xen/arch/x86/mpparse.c b/xen/arch/x86/mpparse.c index ae1e1da93b..d10e4ce9dd 100644 --- a/xen/arch/x86/mpparse.c +++ b/xen/arch/x86/mpparse.c @@ -458,7 +458,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc) if ((clustered_apic_mode == CLUSTERED_APIC_NUMAQ) && mpc->mpc_oemptr) { /* We need to process the oem mpc tables to tell us which quad things are in ... */ mpc_record = 0; - smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr, mpc->mpc_oemsize); + smp_read_mpc_oem((struct mp_config_oemtable *)(unsigned long)mpc->mpc_oemptr, mpc->mpc_oemsize); mpc_record = 0; } @@ -824,7 +824,7 @@ void __init get_smp_config (void) * Read the physical hardware table. Anything here will * override the defaults. */ - if (!smp_read_mpc((void *)mpf->mpf_physptr)) { + if (!smp_read_mpc((void *)(unsigned long)mpf->mpf_physptr)) { smp_found_config = 0; printk(KERN_ERR "BIOS bug, MP table errors detected!...\n"); printk(KERN_ERR "... disabling SMP support. (tell your hw vendor)\n"); diff --git a/xen/arch/x86/rwlock.c b/xen/arch/x86/rwlock.c index 2ef7af16b1..d8c1b7dde5 100644 --- a/xen/arch/x86/rwlock.c +++ b/xen/arch/x86/rwlock.c @@ -6,22 +6,22 @@ asm( ".align 4\n" ".globl __write_lock_failed\n" "__write_lock_failed:\n" -" " LOCK "addl $" RW_LOCK_BIAS_STR ",(%eax)\n" +" " LOCK "addl $" RW_LOCK_BIAS_STR ",(%"__OP"ax)\n" "1: rep; nop\n" -" cmpl $" RW_LOCK_BIAS_STR ",(%eax)\n" +" cmpl $" RW_LOCK_BIAS_STR ",(%"__OP"ax)\n" " jne 1b\n" -" " LOCK "subl $" RW_LOCK_BIAS_STR ",(%eax)\n" +" " LOCK "subl $" RW_LOCK_BIAS_STR ",(%"__OP"ax)\n" " jnz __write_lock_failed\n" " ret\n" ".align 4\n" ".globl __read_lock_failed\n" "__read_lock_failed:\n" -" lock ; incl (%eax)\n" +" lock ; incl (%"__OP"ax)\n" "1: rep; nop\n" -" cmpl $1,(%eax)\n" +" cmpl $1,(%"__OP"ax)\n" " js 1b\n" -" lock ; decl (%eax)\n" +" lock ; decl (%"__OP"ax)\n" " js __read_lock_failed\n" " ret\n" ); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index ed5f3bba67..831a27e092 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -54,6 +54,8 @@ int acpi_force __initdata = 0; int phys_proc_id[NR_CPUS]; int logical_proc_id[NR_CPUS]; +#if defined(__i386__) + /* Standard macro to see if a specific flag is changeable */ static inline int flag_is_changeable_p(u32 flag) { @@ -81,6 +83,12 @@ static int __init have_cpuid_p(void) return flag_is_changeable_p(X86_EFLAGS_ID); } +#elif defined(__x86_64__) + +#define have_cpuid_p() (1) + +#endif + void __init get_cpu_vendor(struct cpuinfo_x86 *c) { char *v = c->x86_vendor_id; @@ -259,6 +267,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c) unsigned long cpu_initialized; void __init cpu_init(void) { +#if defined(__i386__) /* XXX */ int nr = smp_processor_id(); struct tss_struct * t = &init_tss[nr]; @@ -297,6 +306,7 @@ void __init cpu_init(void) write_ptbase(¤t->mm); init_idle_task(); +#endif } static void __init do_initcalls(void) diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index 6a643ada24..ef7a39df89 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -659,7 +659,9 @@ static void __init do_boot_cpu (int apicid) map_cpu_to_boot_apicid(cpu, apicid); +#if defined(__i386__) SET_DEFAULT_FAST_TRAP(&idle->thread); +#endif idle_task[cpu] = idle; diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index dec7618ed7..dfe20e415d 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -107,7 +107,8 @@ static struct irqaction irq0 = { timer_interrupt, "timer", NULL}; static unsigned long __init calibrate_tsc(void) { - unsigned long startlow, starthigh, endlow, endhigh, count; + u64 start, end, diff; + unsigned long count; /* Set the Gate high, disable speaker */ outb((inb(0x61) & ~0x02) | 0x01, 0x61); @@ -123,22 +124,24 @@ static unsigned long __init calibrate_tsc(void) outb(CALIBRATE_LATCH & 0xff, 0x42); /* LSB of count */ outb(CALIBRATE_LATCH >> 8, 0x42); /* MSB of count */ - rdtsc(startlow, starthigh); + rdtscll(start); for ( count = 0; (inb(0x61) & 0x20) == 0; count++ ) continue; - rdtsc(endlow, endhigh); + rdtscll(end); /* Error if the CTC doesn't behave itself. */ if ( count == 0 ) return 0; - /* [endhigh:endlow] = [endhigh:endlow] - [starthigh:startlow] */ - __asm__( "subl %2,%0 ; sbbl %3,%1" - : "=a" (endlow), "=d" (endhigh) - : "g" (startlow), "g" (starthigh), "0" (endlow), "1" (endhigh) ); + diff = end - start; +#if defined(_i386__) /* If quotient doesn't fit in 32 bits then we return error (zero). */ - return endhigh ? 0 : endlow; + if ( diff & ~0xffffffffULL ) + return 0; +#endif + + return (unsigned long)diff; } diff --git a/xen/arch/x86/trampoline.S b/xen/arch/x86/trampoline.S index 064159046d..02018f347a 100644 --- a/xen/arch/x86/trampoline.S +++ b/xen/arch/x86/trampoline.S @@ -43,7 +43,11 @@ r_base = . lmsw %ax # into protected mode jmp flush_instr flush_instr: - ljmpl $__HYPERVISOR_CS, $0x100000 # 1MB +#if defined(__x86_64__) + ljmpl $__HYPERVISOR_CS32, $0x100000 # 1MB +#else + ljmpl $__HYPERVISOR_CS, $0x100000 # 1MB +#endif idt_48: .word 0 # idt limit = 0 diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 59d0e320d6..c43aafea23 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -62,6 +62,8 @@ struct guest_trap_bounce { unsigned long eip; /* 12 */ } guest_trap_bounce[NR_CPUS] = { { 0 } }; +#if defined(__i386__) + #define DOUBLEFAULT_STACK_SIZE 1024 static struct tss_struct doublefault_tss; static unsigned char doublefault_stack[DOUBLEFAULT_STACK_SIZE]; @@ -906,3 +908,5 @@ unsigned long do_get_debugreg(int reg) if ( (reg < 0) || (reg > 7) ) return -EINVAL; return current->thread.debugreg[reg]; } + +#endif /* __i386__ */ diff --git a/xen/arch/x86/domain_page.c b/xen/arch/x86/x86_32/domain_page.c similarity index 100% rename from xen/arch/x86/domain_page.c rename to xen/arch/x86/x86_32/domain_page.c diff --git a/xen/arch/x86/entry.S b/xen/arch/x86/x86_32/entry.S similarity index 100% rename from xen/arch/x86/entry.S rename to xen/arch/x86/x86_32/entry.S diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/x86_32/mm.c similarity index 100% rename from xen/arch/x86/mm.c rename to xen/arch/x86/x86_32/mm.c diff --git a/xen/arch/x86/usercopy.c b/xen/arch/x86/x86_32/usercopy.c similarity index 100% rename from xen/arch/x86/usercopy.c rename to xen/arch/x86/x86_32/usercopy.c diff --git a/xen/arch/x86/xen.lds b/xen/arch/x86/x86_32/xen.lds similarity index 100% rename from xen/arch/x86/xen.lds rename to xen/arch/x86/x86_32/xen.lds diff --git a/xen/arch/x86/x86_64/entry.S b/xen/arch/x86/x86_64/entry.S new file mode 100644 index 0000000000..e69de29bb2 diff --git a/xen/arch/x86/x86_64/usercopy.c b/xen/arch/x86/x86_64/usercopy.c new file mode 100644 index 0000000000..e7c11fa501 --- /dev/null +++ b/xen/arch/x86/x86_64/usercopy.c @@ -0,0 +1,136 @@ +/* + * User address space access functions. + * + * Copyright 1997 Andi Kleen + * Copyright 1997 Linus Torvalds + * Copyright 2002 Andi Kleen + */ +#include + +/* + * Copy a null terminated string from userspace. + */ + +#define __do_strncpy_from_user(dst,src,count,res) \ +do { \ + long __d0, __d1, __d2; \ + __asm__ __volatile__( \ + " testq %1,%1\n" \ + " jz 2f\n" \ + "0: lodsb\n" \ + " stosb\n" \ + " testb %%al,%%al\n" \ + " jz 1f\n" \ + " decq %1\n" \ + " jnz 0b\n" \ + "1: subq %1,%0\n" \ + "2:\n" \ + ".section .fixup,\"ax\"\n" \ + "3: movq %5,%0\n" \ + " jmp 2b\n" \ + ".previous\n" \ + ".section __ex_table,\"a\"\n" \ + " .align 8\n" \ + " .quad 0b,3b\n" \ + ".previous" \ + : "=r"(res), "=c"(count), "=&a" (__d0), "=&S" (__d1), \ + "=&D" (__d2) \ + : "i"(-EFAULT), "0"(count), "1"(count), "3"(src), "4"(dst) \ + : "memory"); \ +} while (0) + +long +__strncpy_from_user(char *dst, const char *src, long count) +{ + long res; + __do_strncpy_from_user(dst, src, count, res); + return res; +} + +long +strncpy_from_user(char *dst, const char *src, long count) +{ + long res = -EFAULT; + if (access_ok(VERIFY_READ, src, 1)) + __do_strncpy_from_user(dst, src, count, res); + return res; +} + +/* + * Zero Userspace + */ + +unsigned long __clear_user(void *addr, unsigned long size) +{ + long __d0; + /* no memory constraint because it doesn't change any memory gcc knows + about */ + asm volatile( + " testq %[size8],%[size8]\n" + " jz 4f\n" + "0: movq %[zero],(%[dst])\n" + " addq %[eight],%[dst]\n" + " decl %%ecx ; jnz 0b\n" + "4: movq %[size1],%%rcx\n" + " testl %%ecx,%%ecx\n" + " jz 2f\n" + "1: movb %b[zero],(%[dst])\n" + " incq %[dst]\n" + " decl %%ecx ; jnz 1b\n" + "2:\n" + ".section .fixup,\"ax\"\n" + "3: lea 0(%[size1],%[size8],8),%[size8]\n" + " jmp 2b\n" + ".previous\n" + ".section __ex_table,\"a\"\n" + " .align 8\n" + " .quad 0b,3b\n" + " .quad 1b,2b\n" + ".previous" + : [size8] "=c"(size), [dst] "=&D" (__d0) + : [size1] "r"(size & 7), "[size8]" (size / 8), "[dst] "(addr), + [zero] "r" (0UL), [eight] "r" (8UL)); + return size; +} + + +unsigned long clear_user(void *to, unsigned long n) +{ + if (access_ok(VERIFY_WRITE, to, n)) + return __clear_user(to, n); + return n; +} + +/* + * Return the size of a string (including the ending 0) + * + * Return 0 on exception, a value greater than N if too long + */ + +long strnlen_user(const char *s, long n) +{ + unsigned long res = 0; + char c; + + if (!access_ok(VERIFY_READ, s, n)) + return 0; + + while (1) { + if (get_user(c, s)) + return 0; + if (!c) + return res+1; + if (res>n) + return n+1; + res++; + s++; + } +} + +unsigned long copy_in_user(void *to, const void *from, unsigned len) +{ + if (access_ok(VERIFY_WRITE, to, len) && access_ok(VERIFY_READ, from, len)) { + return copy_user_generic(to, from, len); + } + return len; +} diff --git a/xen/arch/x86/x86_64/xen.lds b/xen/arch/x86/x86_64/xen.lds new file mode 100644 index 0000000000..caea240e52 --- /dev/null +++ b/xen/arch/x86/x86_64/xen.lds @@ -0,0 +1,85 @@ +/* Excerpts written by Martin Mares */ +OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") +OUTPUT_ARCH(i386:x86-64) +ENTRY(start) +SECTIONS +{ + . = 0xFFFF840000100000; + _text = .; /* Text and read-only data */ + .text : { + *(.text) + *(.fixup) + *(.gnu.warning) + } = 0x9090 + .text.lock : { *(.text.lock) } /* out-of-line lock text */ + + _etext = .; /* End of text section */ + + .rodata : { *(.rodata) *(.rodata.*) } + .kstrtab : { *(.kstrtab) } + + . = ALIGN(16); /* Exception table */ + __start___ex_table = .; + __ex_table : { *(__ex_table) } + __stop___ex_table = .; + + __start___ksymtab = .; /* Kernel symbol table */ + __ksymtab : { *(__ksymtab) } + __stop___ksymtab = .; + + __start___kallsyms = .; /* All kernel symbols */ + __kallsyms : { *(__kallsyms) } + __stop___kallsyms = .; + + .data : { /* Data */ + *(.data) + CONSTRUCTORS + } + + _edata = .; /* End of data section */ + + . = ALIGN(8192); /* init_task */ + .data.init_task : { *(.data.init_task) } + + . = ALIGN(4096); /* Init code and data */ + __init_begin = .; + .text.init : { *(.text.init) } + .data.init : { *(.data.init) } + . = ALIGN(16); + __setup_start = .; + .setup.init : { *(.setup.init) } + __setup_end = .; + __initcall_start = .; + .initcall.init : { *(.initcall.init) } + __initcall_end = .; + . = ALIGN(4096); + __init_end = .; + + . = ALIGN(4096); + .data.page_aligned : { *(.data.idt) } + + . = ALIGN(32); + .data.cacheline_aligned : { *(.data.cacheline_aligned) } + + __bss_start = .; /* BSS */ + .bss : { + *(.bss) + } + _end = . ; + + /* Sections to be discarded */ + /DISCARD/ : { + *(.text.exit) + *(.data.exit) + *(.exitcall.exit) + } + + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } +} diff --git a/xen/include/asm-x86/config.h b/xen/include/asm-x86/config.h index f61f6aeedd..f8cd450451 100644 --- a/xen/include/asm-x86/config.h +++ b/xen/include/asm-x86/config.h @@ -18,8 +18,10 @@ #define CONFIG_ACPI_BOOT 1 #define CONFIG_PCI 1 -#define CONFIG_PCI_BIOS 1 #define CONFIG_PCI_DIRECT 1 +#if defined(__i386__) +#define CONFIG_PCI_BIOS 1 +#endif #define CONFIG_IDE 1 #define CONFIG_BLK_DEV_IDE 1 diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h index 7c5212e50f..1e35752a84 100644 --- a/xen/include/asm-x86/irq.h +++ b/xen/include/asm-x86/irq.h @@ -86,6 +86,8 @@ extern char _stext, _etext; #define __STR(x) #x #define STR(x) __STR(x) +#if defined(__i386__) + #define SAVE_ALL \ "cld\n\t" \ "pushl %gs\n\t" \ @@ -105,8 +107,11 @@ extern char _stext, _etext; "movl %edx,%fs\n\t" \ "movl %edx,%gs\n\t" -#define IRQ_NAME2(nr) nr##_interrupt(void) -#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr) +#else + +#define SAVE_ALL + +#endif #define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v) #define XBUILD_SMP_INTERRUPT(x,v)\ @@ -115,7 +120,7 @@ asmlinkage void call_##x(void); \ __asm__( \ "\n"__ALIGN_STR"\n" \ SYMBOL_NAME_STR(x) ":\n\t" \ - "pushl $"#v"\n\t" \ + "push"__OS" $"#v"\n\t" \ SAVE_ALL \ SYMBOL_NAME_STR(call_##x)":\n\t" \ "call "SYMBOL_NAME_STR(smp_##x)"\n\t" \ @@ -128,13 +133,13 @@ asmlinkage void call_##x(void); \ __asm__( \ "\n"__ALIGN_STR"\n" \ SYMBOL_NAME_STR(x) ":\n\t" \ - "pushl $"#v"\n\t" \ + "push"__OS" $"#v"\n\t" \ SAVE_ALL \ - "movl %esp,%eax\n\t" \ - "pushl %eax\n\t" \ + "mov %"__OP"sp,%"__OP"ax\n\t" \ + "push %"__OP"ax\n\t" \ SYMBOL_NAME_STR(call_##x)":\n\t" \ "call "SYMBOL_NAME_STR(smp_##x)"\n\t" \ - "addl $4,%esp\n\t" \ + "add $4,%"__OP"sp\n\t" \ "jmp ret_from_intr\n"); #define BUILD_COMMON_IRQ() \ @@ -147,12 +152,15 @@ __asm__( \ "call " SYMBOL_NAME_STR(do_IRQ) "\n\t" \ "jmp ret_from_intr\n"); +#define IRQ_NAME2(nr) nr##_interrupt(void) +#define IRQ_NAME(nr) IRQ_NAME2(IRQ##nr) + #define BUILD_IRQ(nr) \ asmlinkage void IRQ_NAME(nr); \ __asm__( \ "\n"__ALIGN_STR"\n" \ SYMBOL_NAME_STR(IRQ) #nr "_interrupt:\n\t" \ - "pushl $"#nr"\n\t" \ + "push"__OS" $"#nr"\n\t" \ "jmp common_interrupt"); extern unsigned long prof_cpu_mask; -- 2.30.2